`include "i2c_mst_agt.sv"
`include "scoreboard.sv"
`include "subscriber.sv"

class i2c_env extends uvm_env;
    i2c_mst_agt  i_agent;
    scoreboard   sb;
    subscriber   sbr;

    `uvm_component_utils(i2c_env)

    function new(string name, uvm_component parent);
        super.new(name, parent);
        `uvm_info("TRACE", $sformatf("%m"), UVM_HIGH)
    endfunction

    virtual function void build_phase(uvm_phase phase);
        super.build_phase(phase);
        `uvm_info("TRACE", $sformatf("%m"), UVM_HIGH)
        
        //create the apb_mst_agt / scoreboard / subscriber
        i_agent= i2c_mst_agt::type_id::create("i_agent", this);
        sb = scoreboard::type_id::create("sb", this);
        sbr = subscriber::type_id::create("sbr",this);
    endfunction

    virtual function void connect_phase(uvm_phase phase);
        i_agent.analysis_port.connect(sb.fifo_before.analysis_export);
        i_agent.analysis_port.connect(sbr.analysis_export);
    endfunction

endclass